// 所有关于购物车功能的vuex设计
var CartStore = {
        namespaced: true, //命名空间 
        state: {
            cartnum: 18
        },
        mutations: {
            changeCartNum(state, num) {
                state.cartnum += num;
            }
        },
        actions: {
            cartAction({ commit }, nu) {
                commit("changeCartNum", nu)
            }
        },
        getters: {
            cartnumDou: state => state.cartnum * 2
        }
    }
    // 默认导出
export default CartStore